﻿using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Extensions.Primitives;

namespace SageKing.Core.Extensions;

public static class ListExts
{

    public static ImmutableArray<T> GetImmutable<T>(this IEnumerable<T> items)
    {

        var builder = ImmutableArray.CreateBuilder<T>();

        foreach (var item in items)
        { 
            builder.Add(item);
        }

        return builder.ToImmutable();
    }
}
